Skip to content

Conversation

@nastra
Copy link
Contributor

@nastra nastra commented Jun 21, 2021

@rdblue looks like I missed a few places in #2714 because Gradle was caching some stuff and therefore didn't recompile & re-run ErrorProne. Turns out one has to delete ~/.gradle/caches/build-cache-1 before running ./gradlew build -x test -x javadoc -x integrationTest locally in order to see all ErrorProne warnings, as otherwise you only get the results for the projects that were re-compiled.

PartitionSpec spec = SparkSchemaUtil.specForTable(spark, sourceTableIdentWithDB.unquotedString());

if (spec == PartitionSpec.unpartitioned()) {
if (Objects.equal(spec, PartitionSpec.unpartitioned())) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking for ref. equality is probably fine here, but it takes a reader longer to navigate the code and figure out whether ref equality is really wanted here vs just using equals()

}

@Override
@SuppressWarnings("ReferenceEquality")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for the boolean isRoot = root == rowType check, which seems to be on purpose, but maybe you could double check whether using ref. equality here is still wanted? Same for SparkTypeToType

@nastra nastra force-pushed the equals-instead-of-ref-equality-2 branch from db6c75d to 2c080c9 Compare June 21, 2021 09:27
@github-actions github-actions bot added the API label Jun 21, 2021
*/
public boolean satisfies(SortField other) {
if (this == other) {
if (Objects.equals(this, other)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though using Ref equlity is correct here, it just takes the reader much longer to verify whether it's the intention or not than just using equals() here

@nastra nastra force-pushed the equals-instead-of-ref-equality-2 branch from 2c080c9 to 65074bc Compare June 22, 2021 06:48
@nastra nastra requested a review from rdblue June 23, 2021 08:04
@rdblue rdblue merged commit 98da974 into apache:master Jun 24, 2021
@nastra nastra deleted the equals-instead-of-ref-equality-2 branch June 25, 2021 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants